package com.xieyingwangluo.yxpart.bean;

import java.io.Serializable;

/**
 * Http请求返回对象
 */

public class Result implements Serializable {

    /**
     * 状态值，0表示成功，其他值表示各种异常
     */
    private Integer code;
    /**
     * 信息描述
     */
    private String msg;
    /**
     * 返回的数据
     */
    private Object res;


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getRes() {
        return res;
    }

    public void setRes(Object res) {
        this.res = res;
    }

    public Result(Integer code, String msg, Object res) {
        this.code = code;
        this.msg = msg;
        this.res = res;
    }

    public Result() {
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", res=" + res +
                '}';
    }

    public static Result generate(Integer code, String msg, Object res){
        Result result = new Result(code,msg,res);
        return result;
    }

}
